package com.macro.mall.controller;

import com.macro.mall.service.OmsCompanyAddressService;
import com.macro.model.OmsCompanyAddress;
import common.api.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 收货地址管理
 */
@Api(value = "收货地址管理",tags = "收货地址管理模块")
@Controller
@RequestMapping("/companyAddress")
public class OmsCompanyAddressController {

    @Autowired
    private OmsCompanyAddressService omsCompanyAddressService;

    @ApiOperation("获取所有的收获地址")
    @GetMapping("/list")
    @ResponseBody
    public CommonResult<List<OmsCompanyAddress>> list(){
        List<OmsCompanyAddress> list = omsCompanyAddressService.list();
        return CommonResult.success(list);
    }
}
